const http = require('http')
let server = http.createServer((req,res)=>{
    console.log(req.url);
    // res.setHeader('Content-Type','text/plain;charset=utf8')
    res.setHeader('Content-Type','text/html;charset=utf8')
    // res.writeHead(404,'not found',{
    //     'Content-Type':'text/plain;charset=utf8'
    // })
    res.write('<h1>你好</h1>')
    res.end()
})

server.listen(3000,()=>{
    let port = server.address().port
    console.log(`server is running port is ${port} `);
})